using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FarseerPhysics.Dynamics;
using Microsoft.Xna.Framework;
using HappyFrogXna.Level;
using HappyFrogXna.DrawingSystem;
using HappyFrogXna.ScreenSystem;
using Microsoft.Xna.Framework.Graphics;
using FarseerPhysics.Factories;
using HappyFrogXna.ParticleSystem;

namespace HappyFrogXna.Roles
{
    class RectStone1 : RectangleEntity
    {
        public RectStone1(World w, Vector2 pos)
            : base(w, pos)
        {
            _world = w;

            _scaleRadio = ScaleRadioDisplayOnScreen;

            EntitySprite = new Sprite(GolbalXnaGadgetProvider.Instance.Content.Load<Texture2D>(@"Images\rectstone1"));
            float width = ConvertUnits.ToSimUnits(EntitySprite.Width) * _scaleRadio;
            float height = ConvertUnits.ToSimUnits(EntitySprite.Height) * _scaleRadio;

            EntityBody = BodyFactory.CreateRectangle(_world, width, height, 1f, pos);
            EntityBody.IsStatic = true;
            EntityBody.Rotation = 0.0f;
            EntityBody.Mass = 1.5f;
            EntityBody.Restitution = 0.1f;
            EntityBody.Friction = 0.2f;

            UserDate = new EntityUserData();
            UserDate.Name = "RectStone1";
            UserDate.Type = EntityType.Stone;
            UserDate.HealthPoint = 100;
        }

        public override void RemoveMe()
        {
            ParticleCreator.Instance.CreateStoneExplosion(ConvertUnits.ToDisplayUnits(EntityBody.Position));
            base.RemoveMe();
        }
    }
}
